package Service;

import Dao.Impl.CarDAOImpl;
import Dao.Impl.CustomerDAOImpl;
import pojo.Car;
import pojo.Customer;

import java.sql.SQLException;
import java.util.List;

public class CustomerService {
    private CustomerDAOImpl customerDAOImpl;

    public CustomerService() throws Exception {
        customerDAOImpl = new CustomerDAOImpl();
    }

    public List<Customer> getAllCustomer() throws Exception {
        List<Customer> customerList = customerDAOImpl.getAllCustomers();
        return customerList;
    }

    //删除顾客
    public void deletecustomer(int del_customerid) throws SQLException {
        customerDAOImpl.deletecustomer(del_customerid);
    }

    //查询部分顾客
    public List<Customer> getCarByBrand(String searchText) throws SQLException {
        return customerDAOImpl.getCarByBrand(searchText);
    }

    public Boolean addcustomer(Customer customer) throws SQLException {
        return customerDAOImpl.addCustomer(customer);
    }
}
